export function throttle(fn, delay) {
    let timeout,
      previous = 0;
    return function() {
      let applyThis = this,
        args = arguments;
      if (!timeout) {
        timeout = setTimeout(function() {
          timeout = null;
          fn.apply(applyThis, args);
        }, delay);
      }
    };
  }